package com.lin.dataobject.dao;

import com.lin.dataobject.Brand;
import com.lin.dataobject.mapper.BrandMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Created by Administrator on 2017-10-25.
 */
@Repository
public class BrandDao {

    @Autowired
    private BrandMapper mapper;

    public List<Brand> pageList(String name,String company, String startTime, String endTime, Integer page, Integer rows){
        Map<String,Object> map=new HashMap<>();
        map.put("name",name);
        map.put("company",company);
        map.put("startTime",startTime);
        map.put("endTime",endTime);
        Integer offset=(page-1)*rows;
        map.put("offset",offset);
        map.put("rows",rows);
        return mapper.pageList(map);
    }
}
